

jQuery(function ($) {
    var user_info = JSON.parse(localStorage.getItem('user_info'));
    if (!user_info) {
        window.location.href = "/login/login.html";
    }
    var url = window.location.search;
    if (url != "") {
        var value1 = url.split('&')[0];
        var value2 = url.split('&')[2];
        var expressCompany = value1.split('=')[1];
        var number = value2.split('=')[1];
        var param = {
            "expressCompany": expressCompany,
            "number": number
        };
        send_ajax('post', '/api/express/query', param, function callback(data) {
            var html = "";
            if (data.code == 200) {
                var data = JSON.parse(data.data);
                var result = data.data;
                if (result) {
                    for (var i = 0; i < result.length; i++) {
                        html += '\n                        <li class="track_details_item">\n                        <div>\n                            <i class="yuan_status1"></i>\n                            <em></em>\n                        </div>\n                        <span class="send_time">' + result[i].ftime + '</span>\n                        <span>' + result[i].context + '</span>\n                    </li>\n                ';
                    }
                    $('.track_details').html(html);
                } else {
                    $('.track_details').html('暂无物流信息，请稍后再试！');
                }

                $(".track_box em:last").remove();
                $(".track_box i:first").addClass('yuan_status2').removeClass('yuan_status1');
            }
        });
    }

    $('.back_page').click(function () {
        window.history.go(-1);
    });
});